﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using System.Collections.Generic;
using DataAccess;

namespace QuanLyKhachSan
{
    public partial class XrptPhieuDat : DevExpress.XtraReports.UI.XtraReport
    {
        HoaDonThuePhongManager controller = new HoaDonThuePhongManager();
        public XrptPhieuDat(string ma)
        {
            InitializeComponent();
            Form_Load(ma);
        }

        private void Form_Load(string ma)
        {
            HoaDonThuePhong hoadon = controller.TimHoaDonTheoDK(hd => hd.MaHD + "" == ma).Result[0];
            xrlblMaSoPhieu.Text = hoadon.MaHD + "";

            XRTableCell cell1 = new XRTableCell();
            XRTableCell cell2 = new XRTableCell();
            XRTableCell cell3 = new XRTableCell();
            XRTableCell cell4 = new XRTableCell();

            cell1.WidthF = 170; cell2.WidthF = 140; cell3.WidthF = 150; cell4.WidthF = 190;
            cell1.Text = hoadon.HoTenNguoiDat;
            cell2.Text = hoadon.NgayDenDuKien.Value.ToShortDateString();
            cell3.Text = hoadon.TienDatCoc + "";
            cell4.Text = hoadon.TrangThai;

            XRTableRow row = new XRTableRow();
            row.Cells.Add(cell1);
            row.Cells.Add(cell2);
            row.Cells.Add(cell3);
            row.Cells.Add(cell4);

            xrTable2.Rows.Add(row);
            xrTable2.Rows[0].Visible = false;

            xrlblTenNguoiDat.Text = hoadon.HoTenNguoiDat;
            xrlblTenNhanVien.Text = hoadon.NhanVien.TenNhanVien;
            xrlblNgayLapHD.Text=hoadon.NgayLapHD.Value.ToShortDateString();
            
        }
    }
}
